﻿@model DateTime?

@{
    DateTime? editorSource = DateTime.MinValue;
    if (Model.HasValue)
    {
        editorSource = Model;
    }
}

@if (ViewBag.Required != null && ViewBag.Required)
{
    @Html.TextBox("", (editorSource == DateTime.MinValue ? string.Empty : String.Format("{0:dd/MM/yyyy}", editorSource)), new { @class = "JDateTime Required", style = "width:70px;" })
}
else
{
    @Html.TextBox("", (editorSource == DateTime.MinValue ? string.Empty : String.Format("{0:dd/MM/yyyy}", editorSource)), new { @class = "JDateTime", style = "width:70px;" })
}
